package com.ljt.aicodehelp.ai;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.Result;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import reactor.core.publisher.Flux;

import java.util.List;

// @AiService
public interface AiCodeHelperService {

    @SystemMessage(fromResource = "system-prompt.txt")
    String chat(String message);

    @SystemMessage(fromResource = "system-prompt.txt")
    String chat(@MemoryId int memoryId,@UserMessage String message);

    @SystemMessage(fromResource = "system-prompt.txt")
    Report chatForReport(@MemoryId int memoryId,@UserMessage String message);

    @SystemMessage(fromResource = "system-prompt.txt")
    String chatWithTool(@MemoryId int memoryId,@UserMessage String message);

    // 下面是用上Result对象
    @SystemMessage(fromResource = "system-prompt.txt")
    Result<String> chatWithResult(String message);

    @SystemMessage(fromResource = "system-prompt.txt")
    Result<String> chatWithResult(@MemoryId int memoryId, @UserMessage String message);

    @SystemMessage(fromResource = "system-prompt.txt")
    Result<Report> chatForReportWithResult(@MemoryId int memoryId, @UserMessage String message);

    // FLUX流式输出（最终版了）
    @SystemMessage(fromResource = "system-prompt.txt")
    Flux<String> chatStream(@MemoryId long memoryId, @UserMessage String message);

    // 自己定义一个类
    record Report(String name, List<String> suggestionList){};
}
